﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
    public partial class LogisticsDetailsMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<LogisticsDetails> {
        public LogisticsDetailsMap() {
            // table
            ToTable("mc_LogisticsDetails", "dbo");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.LogisticsStatus)
                .HasColumnName("LogisticsStatus")
                .IsRequired();
            Property(t => t.LogisticsId)
              .HasColumnName("LogisticsId")
              .IsRequired();
            Property(t => t.LogisticsTime)
               .HasColumnName("LogisticsTime")
               .IsRequired();
            Property(t => t.ManageId)
              .HasColumnName("ManageId")
              .IsRequired();

            HasRequired(t => t.Logistics)
              .WithMany()
              .HasForeignKey(d => d.LogisticsId)
              .WillCascadeOnDelete(false);
            HasRequired(t => t.Manage)
             .WithMany()
             .HasForeignKey(d => d.ManageId)
             .WillCascadeOnDelete(false);


        }
    }
}
